/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.pokemon.other;

import java.sql.Date;
import java.text.ParseException;
import java.text.SimpleDateFormat;

public class DateConvertor {
    public static Date StringToDate(String v) {
    SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-mm-dd");
    java.sql.Date sqlDate = null;
    try {
             java.util.Date convertedDate = dateFormat.parse(v);
             sqlDate = new java.sql.Date(convertedDate.getTime());
        } catch (ParseException e) {
            e.printStackTrace();
        }
    return sqlDate;
    }
    public static String DateToString(Date val) throws Exception {
        return val.toString();
    }
}